package com.fqgj.xjd.user.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.xjd.user.dao.UserAuthAccountDao;
import com.fqgj.xjd.user.entity.UserAuthAccountEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* User: zhangxingyun
* Date: 2017-07-20
* Time: 18:38:52.914
*/

@Repository
public class UserAuthAccountDaoImpl extends AbstractBaseMapper<UserAuthAccountEntity> implements UserAuthAccountDao {

    @Override
    public UserAuthAccountEntity selectUserAuthAccountByAccountNameAndType(String accountName, String type) {
        Map params = new HashMap();
        params.put("type",type);
        params.put("accountName",accountName);
        return getSqlSession().selectOne(getStatement("selectUserAuthAccountByAccountNameAndType"),params);
    }

    @Override
    public List<UserAuthAccountEntity> selectUserAuthAccountListByUserCode(String userCode) {
        return getSqlSession().selectList(getStatement("selectUserAuthAccountListByUserCode"),userCode);
    }

    @Override
    public UserAuthAccountEntity selectUserAuthAccountByUserCode(String userCode, String type, Boolean checkPassword) {
        Map params = new HashMap();
        params.put("userCode",userCode);
        params.put("type",type);
        params.put("checkPassword",checkPassword);
        return getSqlSession().selectOne(getStatement("selectUserAuthAccountByUserCode"),params);
    }
}